package com.cy.store.service;

import com.cy.store.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

// 用户模块业务层接口
public interface IUserService {

    /**
     * 用户注册方法
     * @param user
     * @author AngJie
     * @creed: Talk is cheap,show me the code
     * @date 2022/2/6 0006 0:06
     */
    void regist(User user);

    /**
     * 用户登录方法
     * @param user
     * @return 查询成功的User对象,无则返回Null
     * @author AngJie
     * @creed: Talk is cheap,show me the code
     * @date 2022/2/6 0006 16:23
     */
    User login(User user);


    /**
     * 修改密码
     * @param uid
	 * @param oldPassword
	 * @param newPassword
     * @return void
     * @author AngJie
     * @creed: Talk is cheap,show me the code
     * @date 2022/2/6 0006 19:37
     */
    void changePassword(Integer uid,
                        String oldPassword,
                        String newPassword);

    /**
     * 根据用户的id查询用户数据
     * @param uid
     * @return 根据uid查到的用户数据
     */
    User getByUid(Integer uid);

    /**
     *  更新用户的数据
     * @param uid
     * @param user
     */
    void changeInfo(Integer uid,User user);

    /**
     * 用户上传头像
     * @param uid
     * @param avatar 用户的头像
     */
    void changeAvatar(Integer uid,String avatar);
}
